/**
 * str:字符串 beginStr:开始位置 endStr:结束位置；
 */
function desensitization(str, frontLen, endLen) {
  var len = str.length - frontLen - endLen;
  var xing = "";
  for (var i = 0; i < len; i++) {
    xing += "*";
  }
  return str.substring(0, frontLen) + xing + str.substring(str.length - endLen);
}

// let str = "123456789";
// let r = desensitization(str, 2, 2);
// console.log(r);
module.exports = {
  desensitization,
};
